package com.snowflake.ecatalog.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.snowflake.ecatalog.contant.Status;

/**
 * 企业分类标准
 */
// JPA标识
@Entity
@Table(name = "t_ec_ccategorystd")
public class CompanyCategoryStandard extends OpEntity {
	private String number;
	private String name;
	private String remark;
	private int status;
	private List<CompanyCategory> categorys;

	public CompanyCategoryStandard() {
		super();
	}

	public CompanyCategoryStandard(Long id) {
		super();
		this.id = id;
	}

	@OneToMany(cascade = { CascadeType.REFRESH }, mappedBy = "std")
	public List<CompanyCategory> getCategorys() {
		return categorys;
	}

	public void setCategorys(List<CompanyCategory> categorys) {
		this.categorys = categorys;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	// 不持久化到数据库
	@Transient
	public String getStatusName() {
		return Status.alias(this.status);
	}
}
